﻿using System.ComponentModel;

using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;


namespace Teacker_kit_Blank_App.ViewModels
{
    public abstract class ViewModelBase : INotifyPropertyChanged, ICleanup
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public void Cleanup()
        {
             Messenger.Default.Unregister<NotificationMessage>(this);             
        }
    }
}